﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<title>マクロの部分実行</title>
<LINK REL="stylesheet" TYPE="text/css" HREF="../sakura.css">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
</head>
<small>
Sakura-Editor Macro Reference
</small>
<h2>マクロの部分実行</h2>
<dl>
	<dt>機能</dt>
		<dd>マクロを部分実行するためのサンプルスクリプトです。</dd>
	<dt>説明</dt>
		<dd>
		動作させたい部分をクリップボードにコピーし、
		実行したい環境で本スクリプトを実行します。
		</dd>
</dl>

<h3>JScript用</h3>
<pre>
<span style="color:green">//ClipMacro.js</span>
<span style="color:blue">var</span> oIE = <span style="color:blue">new</span> ActiveXObject(<span style="color:#800000">"InternetExplorer.Application"</span>);
oIE.Navigate(<span style="color:#800000">"about:blank"</span>);
<span style="color:blue">var</span> sRet = oIE.Document.parentWindow.clipboardData.getData(<span style="color:#800000">"Text"</span>);
<span style="color:blue">eval</span>(sRet);
</pre>

<h3>VBScript用</h3>
<pre>
<span style="color:green">&#39;ClipMacro.vbs</span>
<span style="color:blue">Set</span> oIE = CreateObject(<span style="color:#800000">"InternetExplorer.Application"</span>)
oIE.Navigate(<span style="color:#800000">"about:blank"</span>)
sRet = oIE.Document.parentWindow.clipboardData.getData(<span style="color:#800000">"Text"</span>)
<span style="color:blue">Set</span> oIE = <span style="color:blue">Nothing</span>
<span style="color:blue">Execute</span> sRet
</pre>

<h3>PerlScript用</h3>
<pre>
<span style="color:green;">#ClipMacro.pls</span>
<span style="color:blue;">use</span> Win32::Clipboard;
$CLIP = Win32::Clipboard();
<span style="color:blue;">eval</span>($CLIP-&gt;<span style="color:blue;">GetText</span>());
</pre>


<hr>
</body></html>

